package com.example.springbootdemo.exception;

/**
 * 业务自定义异常
 * @author hh
 * @date 2022/1/19
 */
public class BusinessErrorException extends RuntimeException{

    /**
     * 异常码
     */
    private int code;
    /**
     * 异常提示信息
     */
    private String msg;

    public BusinessErrorException(BusinessResponseEnum businessResponseEnum) {
        this.code = businessResponseEnum.code();
        this.msg = businessResponseEnum.value();
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

}
